From c25265953b9c06fafc6091982468ed0cfc30abb0 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sun, 23 Nov 2025 09:58:30 +0100 Subject: [PATCH] libcap: update to 2.77 Update to latest release. Add patch `003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch` to fix errors in the form of: ``` /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(__stack_chk_fail.o): relocation R_X86_64_32 against symbol `__stack_chk_guard' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(strerror.o): relocation R_X86_64_32 against `.rodata.errmsgstr' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(realloc.o): relocation R_X86_64_32S against hidden symbol `__malloc_size_classes' can not be used when making a PIE object /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(__stdout_write.o): relocation R_X86_64_32S against hidden symbol `__stdio_write' can not be used when making a PIE object /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(ofl.o): relocation R_X86_64_32 against `.bss.ofl_lock' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld.bfd: /external-toolchain/openwrt-toolchain-x86-64_gcc-14.3.0_musl.Linux-x86_64/toolchain-x86_64_gcc-14.3.0_musl/lib/libc.a(stderr.o): warning: relocation against `__stderr_FILE' in read-only section `.rodata.stderr' /usr/bin/ld.bfd: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x12): undefined reference to `__libc_csu_fini' /usr/bin/ld.bfd: (.text+0x19): undefined reference to `__libc_csu_init' collect2: error: ld returned 1 exit status ``` Changes: https://git.kernel.org/pub/scm/libs/libcap/libcap.git/diff/?id=v1.2.77&id2=v1.2.69&dt=2 The apk size did not increase much: Old size for armsr/armv8: 16245 libcap-2.69-r1.apk new size for armsr/armv8: 16315 libcap-2.77-r1.apk Signed-off-by: Nick Hainke Link: https://github.com/openwrt/openwrt/pull/20881 Signed-off-by: Hauke Mehrtens --- package/libs/libcap/Makefile | 4 +-- ...Add-build-ldflags-to-_makenames-rule.patch | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch diff --git a/package/libs/libcap/Makefile b/package/libs/libcap/Makefile index 989209302a..ab74ff4681 100644 --- a/package/libs/libcap/Makefile +++ b/package/libs/libcap/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libcap -PKG_VERSION:=2.69 +PKG_VERSION:=2.77 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2 -PKG_HASH:=f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb +PKG_HASH:=897bc18b44afc26c70e78cead3dbb31e154acc24bee085a5a09079a88dbf6f52 PKG_MAINTAINER:=Paul Wassi PKG_LICENSE:=GPL-2.0-only diff --git a/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch b/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch new file mode 100644 index 0000000000..7c5f03bdb9 --- /dev/null +++ b/package/libs/libcap/patches/003-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch @@ -0,0 +1,27 @@ +From 542d7d86ecd2129dd5fe7e5b31ba307304f5b319 Mon Sep 17 00:00:00 2001 +From: "Andrew G. Morgan" +Date: Mon, 10 Nov 2025 18:26:34 -0800 +Subject: [PATCH] Revert "libcap: Add build ldflags to _makenames rule" + +This reverts commit c3ddf45d9afaab85d3b7db0dc7bfd1aafb8fde50. + +The details of what this broke are here: + + https://bugzilla.kernel.org/show_bug.cgi?id=220691#c2 + +Signed-off-by: Andrew G. Morgan +--- + libcap/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/libcap/Makefile ++++ b/libcap/Makefile +@@ -80,7 +80,7 @@ $(PSXTITLE).pc: $(PSXTITLE).pc.in + $< >$@ + + _makenames: _makenames.c cap_names.list.h +- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@ $(BUILD_LDFLAGS) ++ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@ + + cap_names.h: _makenames + ./_makenames > cap_names.h -- 2.30.2